using System.Collections;
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(RCCDashboardInputs))]
public class RCCUIDashboardDisplay : MonoBehaviour
{
	private RCCDashboardInputs inputs;

	public Text RPMLabel;

	public Text KMHLabel;

	public Text GearLabel;

	public Image ABS;

	public Image ESP;

	public Image Park;

	public Image Headlights;

	public Text speed_value;

	private void Start()
	{
		inputs = GetComponent<RCCDashboardInputs>();
		StartCoroutine("LateDisplay");
	}

	private void OnEnable()
	{
		StopAllCoroutines();
		StartCoroutine("LateDisplay");
	}

	private IEnumerator LateDisplay()
	{
		while (true)
		{
			yield return new WaitForSeconds(0.04f);
			speed_value.text = inputs.KMH.ToString("0") + "   KM/H";
		}
	}
}
